From: Sam Reed Date: Sun, 11 Dec 2011 18:39:31 +0000 (+0000) Subject: * (bug 32415) Empty page get no size attribute in API output X-Git-Tag: 1.31.0-rc.0~26080 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=9457d80c3f3c01df9ed78c1450bb378618571870;p=lhc%2Fweb%2Fwiklou.git * (bug 32415) Empty page get no size attribute in API output --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 721603bedb..b786568715 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -203,6 +203,7 @@ production. * Added 'APIGetDescription' hook. * (bug 32688) Paraminfo for parameter "generator" of the query module shows too many types +* (bug 32415) Empty page get no size attribute in API output === Languages updated in 1.19 === diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 7cfe3f42bf..dcadc41f7f 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -404,8 +404,12 @@ class ApiQueryRevisions extends ApiQueryBase { $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $revision->getTimestamp() ); } - if ( $this->fld_size && !is_null( $revision->getSize() ) ) { - $vals['size'] = intval( $revision->getSize() ); + if ( $this->fld_size ) { + if ( !is_null( $revision->getSize() ) ) { + $vals['size'] = intval( $revision->getSize() ); + } else { + $vals['size'] = 0; + } } if ( $this->fld_comment || $this->fld_parsedcomment ) {